#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>

int main(){
    
    close(1);
    int fd = open("log1.txt", O_CREAT | O_WRONLY | O_TRUNC, 0666);

    printf("fd: %d\n", fd);
    fprintf(stdout, "helloworld");

    fflush(stdout);
    close(fd);
}
